import axios from 'axios';


export default {
  pageList(queryParam) {
    return axios.get('/api/admin/jobPostings/list', { params: queryParam });
  },
  deletePosition(id) {
    return axios.delete('/api/admin/jobPostings/delete/' + id);
  },
  select(id) {
    return axios.get('/api/admin/jobPostings/get/' + id);
  },
  edit(query) {
    return axios.post('/api/admin/jobPostings/edit', query);
  },
  saveMbtiTypes(data) {
    const jobMBTIList = data.types.map(type => ({
      jobId: data.jobId,
      mbtiType: type
    }));
    return axios.post('/api/admin/jobMbti/batchAdd', jobMBTIList);
  },
  getMbtiTypes(jobId) {
    return axios.get(`/api/admin/jobPostings/mbti/${jobId}`);
  }
};
